﻿Imports System.Data.OleDb
Public Class Addreview
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

    Protected Sub btn_pr_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btn_pr.Click
        Dim sql As String = "INSERT INTO review (Title,content,postedby) VALUES (@f1,@f2,@f3)"
        Dim conn As OleDbConnection = New OleDbConnection(ConfigurationManager.ConnectionStrings("DealsDbConnection").ConnectionString)
        Dim cmd As OleDbCommand = New OleDbCommand(sql, conn)
        cmd.Parameters.AddWithValue("@f1", tb_pt.Text)
        cmd.Parameters.AddWithValue("@f2", tb_rc.Text)
        cmd.Parameters.AddWithValue("@f3", User.Identity.Name)



        conn.Open()
        cmd.ExecuteNonQuery()
        conn.Close()
        cmd.Dispose()
        conn.Dispose()
        Response.Redirect("reviewlist.aspx")
    End Sub
End Class